#include<iostream>
#include<algorithm>
using namespace std;
const int N=1e5+10;
typedef long long LL;
int n;
int a[N*3];
int main()
{
	cin>>n;
	for(int i=1;i<=3*n;i++){
		cin>>a[i];
	}
	sort(a+1,a+3*n+1);
	LL ans=0;
	int cnt=0;
	int idx=3*n-1;
	while(cnt!=n){
		ans+=a[idx];
		idx-=2;
		cnt++;
	}
	cout<<ans<<endl;
    return 0;
}
